<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{count}}</h1>
        <h2>总数：{{test2}}</h2>
        <h2>总数：{{test2}}</h2>
        <div></div>
        <h2>总数：{{test2}}</h2>
    </div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    new Vue ({
        el:"#app",
        data:{
            count:1
        },
        methods:{
            test() {
                this.count+=1
            }
        },
        computed:{
            test2() {
                console.log("调用了computed方法")
                return 3*this.count
               
            }
        }
    })
</script>